<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/1.4.8/angular.js"></script>
</head>
<body>
<div ng-controller="myCtrl as o">
    <div ng-click="o.click('父级',$event)">
        在按钮的单击事件中，阻止冒泡现象
        <br>
        <input type="checkbox" ng-click="o.change($event)"
               ng-model="o.stopPropagation">是否阻止冒泡？
        <br><br>
        <button type="button" ng-click="o.click('按钮',$event)">点我</button>
    </div>
</div>
<script type="application/javascript">
    var app = angular.module("app", []);
    app.controller("myCtrl", ["$scope", function ($scope) {
        var obj = this;
        obj.click = function (name,$event) {
            console.log(name + "被触发！");
            if(obj.stopPropagation){
                $event.stopPropagation();
            }
        };
        obj.change = function ($event) {
            $event.stopPropagation();
        }
        return obj;
    }]);
</script>
</body>
</html>